//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CWordsDictionary {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CWordsDictionary(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CWordsDictionary obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CWordsDictionary(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void set_CWordsDictionaryInstanceCounter(SWIGTYPE_p_NLMISC__CWordsDictionary__CWordsDictionaryInstanceCounter value) {
    nelmiscJNI.CWordsDictionary__CWordsDictionaryInstanceCounter_set(swigCPtr, this, SWIGTYPE_p_NLMISC__CWordsDictionary__CWordsDictionaryInstanceCounter.getCPtr(value));
  }

  public SWIGTYPE_p_NLMISC__CWordsDictionary__CWordsDictionaryInstanceCounter get_CWordsDictionaryInstanceCounter() {
    long cPtr = nelmiscJNI.CWordsDictionary__CWordsDictionaryInstanceCounter_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CWordsDictionary__CWordsDictionaryInstanceCounter(cPtr, false);
  }

  public CWordsDictionary() {
    this(nelmiscJNI.new_CWordsDictionary(), true);
  }

  public boolean init(String configFileName) {
    return nelmiscJNI.CWordsDictionary_init__SWIG_0(swigCPtr, this, configFileName);
  }

  public boolean init() {
    return nelmiscJNI.CWordsDictionary_init__SWIG_1(swigCPtr, this);
  }

  public void lookup(CSString inputStr, SWIGTYPE_p_std__vectorT_NLMISC__CSString_t resultVec) {
    nelmiscJNI.CWordsDictionary_lookup(swigCPtr, this, CSString.getCPtr(inputStr), inputStr, SWIGTYPE_p_std__vectorT_NLMISC__CSString_t.getCPtr(resultVec));
  }

  public void exactLookupByKey(CSString key, SWIGTYPE_p_std__vectorT_NLMISC__CSString_t resultVec) {
    nelmiscJNI.CWordsDictionary_exactLookupByKey(swigCPtr, this, CSString.getCPtr(key), key, SWIGTYPE_p_std__vectorT_NLMISC__CSString_t.getCPtr(resultVec));
  }

  public CSString getWordsKey(CSString resultStr) {
    return new CSString(nelmiscJNI.CWordsDictionary_getWordsKey(swigCPtr, this, CSString.getCPtr(resultStr), resultStr), true);
  }

  public SWIGTYPE_p_std__vectorT_NLMISC__CSString_t getKeys() {
    return new SWIGTYPE_p_std__vectorT_NLMISC__CSString_t(nelmiscJNI.CWordsDictionary_getKeys(swigCPtr, this), false);
  }

  public SWIGTYPE_p_std__vectorT_NLMISC__CSString_t getWords() {
    return new SWIGTYPE_p_std__vectorT_NLMISC__CSString_t(nelmiscJNI.CWordsDictionary_getWords(swigCPtr, this), false);
  }

  public Vector_String getFileList() {
    return new Vector_String(nelmiscJNI.CWordsDictionary_getFileList(swigCPtr, this), false);
  }

}
